Object.defineProperty(exports, "__esModule", {
    value: !0
}), exports.loadAccount = void 0;

var _api = _interopRequireDefault(require("./api")), _eventEmitter = _interopRequireDefault(require("../public/utils/event-emitter"));

function _interopRequireDefault(e) {
    return e && e.__esModule ? e : {
        default: e
    };
}

var loadAccount = function(e) {
    var t = getApp().globalData.card;
    return _api.default.minicard.agent.account({
        data: {
            agentid: t.agent ? t.agent.agentid : ""
        },
        complete: e
    }).catch(function() {
        return {};
    }).then(function(e) {
        var t = e.data;
        return _eventEmitter.default.emit("service.data.change", t), t;
    });
};

exports.loadAccount = loadAccount;